<html>
<head><meta charset="utf-8"><title>tidy line lengths · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html">tidy line lengths</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240354208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354208">(May 26 2021 at 16:42)</a>:</h4>
<p>I know tidy enforces our 100 char line length limit, but I have some comments that accidentally went over the 100 limit like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">          </span><span class="c1">// bla bla bla ... (line is 120 chars long)</span>
</code></pre></div>
<p>and tidy doesn't seem to care at all? </p>
<div class="codehilite"><pre><span></span><code>PS D:\code\rust&gt; python x.py test tidy
Updating only changed submodules
Submodules updated in 0.15 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 2.27s
tidy check
Checking which error codes lack tests...
* 625 error codes
* highest error code: E0783
Found 517 error codes
Found 0 error codes with no tests
Done!
* 335 features
fmt check
Build completed successfully in 0:00:44
</code></pre></div>
<p>Is that intended?</p>



<a name="240354443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354443">(May 26 2021 at 16:44)</a>:</h4>
<p>a bit strange, I had a tidy failure for the length of a comment yesterday -- it was <a href="https://github.com/rust-lang/rust/commit/7d4b5188da752361fecd74508a54eea2577e1eab#diff-8d39858cc56191ec3b6be154cdc2cf7acd5a7a3d28089ceb1620737540c094f5R8">in this test</a>, caught <a href="https://github.com/rust-lang/rust/pull/85633#issuecomment-847108399">here</a></p>



<a name="240354462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354462">(May 26 2021 at 16:44)</a>:</h4>
<p>weird...</p>



<a name="240354522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354522">(May 26 2021 at 16:45)</a>:</h4>
<p>There's no comment disabling tidy that I can see in this file</p>



<a name="240354620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354620">(May 26 2021 at 16:45)</a>:</h4>
<p>does tidy only check files tracked by git maybe ?</p>



<a name="240354871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354871">(May 26 2021 at 16:47)</a>:</h4>
<p>Yes but it's checked into git</p>



<a name="240354891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354891">(May 26 2021 at 16:47)</a>:</h4>
<p>which file is this in?</p>



<a name="240354894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354894">(May 26 2021 at 16:47)</a>:</h4>
<p><span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="240354977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240354977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240354977">(May 26 2021 at 16:48)</a>:</h4>
<p><code>compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs</code></p>



<a name="240355001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355001">(May 26 2021 at 16:48)</a>:</h4>
<p>uh, just compiler/, right?</p>



<a name="240355070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355070">(May 26 2021 at 16:48)</a>:</h4>
<p>uh yeah</p>



<a name="240355077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355077">(May 26 2021 at 16:48)</a>:</h4>
<p>srry</p>



<a name="240355220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355220">(May 26 2021 at 16:50)</a>:</h4>
<p>we don't check line length in rustfmt-controlled files</p>



<a name="240355224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355224">(May 26 2021 at 16:50)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/e942a6742ca8f47abfdc48c5e52e520aebd2100a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs#L1550">https://github.com/rust-lang/rust/blob/e942a6742ca8f47abfdc48c5e52e520aebd2100a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs#L1550</a></p>



<a name="240355323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355323">(May 26 2021 at 16:50)</a>:</h4>
<p>Oh so I guess rustfmt doesn't care about the line length of comments then?</p>



<a name="240355327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355327">(May 26 2021 at 16:50)</a>:</h4>
<p>(Under the assumption that rustfmt already reflows it)</p>



<a name="240355336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355336">(May 26 2021 at 16:50)</a>:</h4>
<p>but yeah I guess it doesn't touch comments</p>



<a name="240355361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355361">(May 26 2021 at 16:50)</a>:</h4>
<p>so perhaps a bug in that logic :)</p>



<a name="240355376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355376">(May 26 2021 at 16:51)</a>:</h4>
<p>that's 99 chars right ?</p>



<a name="240355423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355423">(May 26 2021 at 16:51)</a>:</h4>
<p>VSCode says 126 including the whitespace at the beginning</p>



<a name="240355619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355619">(May 26 2021 at 16:52)</a>:</h4>
<p>I can manually reformat but I guess we should log a bug somewhere?</p>



<a name="240355691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355691">(May 26 2021 at 16:52)</a>:</h4>
<p>(assuming we don't want the current behavior)</p>



<a name="240355701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355701">(May 26 2021 at 16:52)</a>:</h4>
<p>not for me</p>



<a name="240355748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355748">(May 26 2021 at 16:53)</a>:</h4>
<p>interesting :)</p>



<a name="240355803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355803">(May 26 2021 at 16:53)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> It's not 126 chars for you?</p>



<a name="240355827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355827">(May 26 2021 at 16:53)</a>:</h4>
<p>Or you don't want the behavior? :)</p>



<a name="240355841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355841">(May 26 2021 at 16:53)</a>:</h4>
<p>this exact line you linked above ?</p>



<a name="240355847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355847">(May 26 2021 at 16:53)</a>:</h4>
<p>Yeah</p>



<a name="240355877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355877">(May 26 2021 at 16:54)</a>:</h4>
<p>it's 99 chars for me</p>



<a name="240355889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355889">(May 26 2021 at 16:54)</a>:</h4>
<p>Wait</p>



<a name="240355947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355947">(May 26 2021 at 16:54)</a>:</h4>
<p>Clicked the wrong line</p>



<a name="240355949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355949">(May 26 2021 at 16:54)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/e942a6742ca8f47abfdc48c5e52e520aebd2100a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs#L1628">https://github.com/rust-lang/rust/blob/e942a6742ca8f47abfdc48c5e52e520aebd2100a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs#L1628</a></p>



<a name="240355986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355986">(May 26 2021 at 16:54)</a>:</h4>
<p>There's a bunch of lines after this that are all longer than 100 chars but tidy doesn't care</p>



<a name="240355996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240355996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240355996">(May 26 2021 at 16:54)</a>:</h4>
<p>that's reassuring</p>



<a name="240356096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356096">(May 26 2021 at 16:55)</a>:</h4>
<p>interesting find :)</p>



<a name="240356289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356289">(May 26 2021 at 16:56)</a>:</h4>
<p>I'll see if this is a known behavior upstream on rustfmt but I guess I should also log a bug for tidy in case rustfmt wants the current behavior for some reason.</p>



<a name="240356915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356915">(May 26 2021 at 17:00)</a>:</h4>
<p>Hmm looks like rustfmt does not format comments by default and the options to tell it to do so are not stable.</p>



<a name="240356969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356969">(May 26 2021 at 17:01)</a>:</h4>
<p>we're using the unstable version IIRC right ?</p>



<a name="240356990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356990">(May 26 2021 at 17:01)</a>:</h4>
<p>yes, we can use unstable options</p>



<a name="240356993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240356993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240356993">(May 26 2021 at 17:01)</a>:</h4>
<p>(one nightly)</p>



<a name="240357061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240357061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240357061">(May 26 2021 at 17:01)</a>:</h4>
<p>I will try setting these options in rustfmt.toml and see how terrible the diff is</p>



<a name="240357069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240357069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240357069">(May 26 2021 at 17:02)</a>:</h4>
<p>the version 2 config we're using is unstable IIRC</p>



<a name="240357788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240357788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240357788">(May 26 2021 at 17:07)</a>:</h4>
<p>I think I have the right options picked </p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="n">comment_line_length</span> <span class="o">=</span><span class="mi">100</span>
<span class="n">wrap_comments</span> <span class="o">=</span> <span class="kc">true</span>
</code></pre></div>
<p>It seems to want to make consecutive comment lines always wrap as close to 100 as possible and a lot of our existing comments don't wrap exactly where they should. </p>
<div class="codehilite"><pre><span></span><code> 401 files changed, 3020 insertions(+), 3121 deletions(-)
</code></pre></div>



<a name="240358549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240358549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240358549">(May 26 2021 at 17:13)</a>:</h4>
<p>Some of these diffs don't look great</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs</span>
<span class="gh">index 2d463a4588c..57931ffbb91 100644</span>
<span class="gd">--- a/compiler/rustc_ast/src/tokenstream.rs</span>
<span class="gi">+++ b/compiler/rustc_ast/src/tokenstream.rs</span>
<span class="gu">@@ -249,8 +249,9 @@ pub fn to_tokenstream(&amp;self) -&gt; TokenStream {</span>
                         // Check the last two trees (to account for a trailing semi)
                         for (tree, _) in target_tokens.iter_mut().rev().take(2) {
                             if let TokenTree::Delimited(span, delim, delim_tokens) = tree {
<span class="gd">-                                // Inner attributes are only supported on extern blocks, functions, impls,</span>
<span class="gd">-                                // and modules. All of these have their inner attributes placed at</span>
<span class="gi">+                                // Inner attributes are only supported on extern blocks, functions,</span>
<span class="gi">+                                // impls, and modules. All of these</span>
<span class="gi">+                                // have their inner attributes placed at</span>
                                 // the beginning of the rightmost outermost braced group:
                                 // e.g. fn foo() { #![my_attr} }
                                 //
</code></pre></div>



<a name="240358634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240358634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240358634">(May 26 2021 at 17:14)</a>:</h4>
<p>not great</p>



<a name="240358740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240358740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240358740">(May 26 2021 at 17:14)</a>:</h4>
<p>oof</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gu">@@ -358,24 +357,21 @@ enum ParenthesizedGenericArgs {</span>
 /// one in `&amp;T` or `Ref&lt;T&gt;`, and you have `'_` lifetimes, like `&amp;'_ T`
 /// or `Ref&lt;'_, T&gt;`. These often behave the same, but not always:
 ///
 /// - certain usages of implicit references are deprecated, like
 ///   `Ref&lt;T&gt;`, and we sometimes just give hard errors in those cases
 ///   as well.
<span class="gd">-/// - for object bounds there is a difference: `Box&lt;dyn Foo&gt;` is not</span>
<span class="gd">-///   the same as `Box&lt;dyn Foo + '_&gt;`.</span>
<span class="gi">+/// - for object bounds there is a difference: `Box&lt;dyn Foo&gt;` is not the same as `Box&lt;dyn Foo +</span>
<span class="gi">+///   '_&gt;`.</span>
</code></pre></div>



<a name="240358821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240358821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240358821">(May 26 2021 at 17:15)</a>:</h4>
<p>I think I'm just going to file a bug on rust-lang/rust and say that comment only lines are no longer being checked for length by tidy.</p>



<a name="240358978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240358978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240358978">(May 26 2021 at 17:16)</a>:</h4>
<p>I hesitate to say it, but "not a bug" :)</p>



<a name="240359000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240359000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240359000">(May 26 2021 at 17:16)</a>:</h4>
<p>we'll probably want to fix those eventually, right ? but not via rustfmt evidently</p>



<a name="240359009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240359009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240359009">(May 26 2021 at 17:16)</a>:</h4>
<p>words are always hard to wrap</p>



<a name="240363061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/tidy%20line%20lengths/near/240363061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/tidy.20line.20lengths.html#240363061">(May 26 2021 at 17:46)</a>:</h4>
<blockquote>
<p>oof</p>
</blockquote>
<p>I wonder if rustfmt should have a rule to not split a code block over multiple lines...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>